package com.example.zhiran.mapper;

import com.example.zhiran.pojo.orm.ZRResource;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ZRResourceMapper {

    //获得所有resource
    List<ZRResource> getAllResources();
    //todo 根据filename来获得resource

    //查询所有未审核的resource（按照时间升序）
    List<ZRResource> getUnreviewedResources();

    //分页查询未审核的resource（按照时间升序）
    List<ZRResource> getUnreviewedResourceLimit(@Param("row") int row, @Param("offset") int offset);

    //根据用户id查询resource
    List<ZRResource> getResourcesByUserId(String zrId);

    //插入一条resource
    int insertResource(ZRResource zrResource);

    //删除一条resource
    int deleteResource(String rsId);

}
